package com.wenlong.agricultural.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenlong.agricultural.mapper.CommodityMapper;
import com.wenlong.agricultural.pojo.CommodityInfo;
import com.wenlong.agricultural.service.CommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 苏文龙
 * @version 1.0
 */
@Service
public class CommodityServiceImpl  extends ServiceImpl<CommodityMapper, CommodityInfo> implements CommodityService{
    @Autowired
    private CommodityMapper commodityMapper;
    @Override
    public List<CommodityInfo> getAllCommodity() {
        return commodityMapper.selectList(null);
    }

    @Override
    public Page<CommodityInfo> getCommoditiesByBage(Long cur, Long size) {
        Page<CommodityInfo> page = new Page<>(cur, size);
        commodityMapper.selectPage(page, null);
        return page;
    }


}
